import React from 'react';

// 导入创建路由的函数
import { createHashRouter } from 'react-router-dom';

import PageSpin from '@/components/Spin';

import IndexPage from '@/views/Index';
const AdminPage = React.lazy(() => import('@/views/2025/Admin'))
const FrontPage = React.lazy(() => import('@/views/2025/Front'))
const Admin_2026 = React.lazy(() => import('@/views/2026/Admin'))
import NotFound from '@/views/404';
// 路由
const routeList = [
  {
    path: '/',
    element: <IndexPage />,
    label: '入口',
  },
  {
    path: '/2025/admin',
    element: <React.Suspense fallback={<PageSpin />}><AdminPage /></React.Suspense>,
    label: '后台装修',
  },
  {
    path: '/2025/front',
    element: <React.Suspense fallback={<PageSpin />}><FrontPage /></React.Suspense>,
    label: '前台装修',
  },
  {
    path: '/2026/admin',
    element: <React.Suspense fallback={<PageSpin />}><Admin_2026 /></React.Suspense>,
    label: '后台装修',
  },
  {
    path: '*',
    element: <NotFound />,
    label: '404',
  }
]

// 创建hash类型的路由
const router = createHashRouter(routeList);

export default router;
